<!DOCTYPE html>
<html lang="en">
<head>
    <title>掌上配镜宝</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="/admin/favicon.ico" />
    <link href="/res/css/share/style.default.css" rel="stylesheet">

</head>

<body id="signin" class="signin">


<section>
  
    <div class="signinpanel">
        
        <div class="row">
            
            <div class="col-md-7">

                <div class="signin-info">
                    <div class="logopanel">
                        <h1>掌上配镜宝</h1>
                    </div><!-- logopanel -->
                
                    <div class="mb20"></div>
                
                    <h5><strong>欢迎您使用掌上配镜宝系统</strong></h5>

                </div><!-- signin0-info -->
            
            </div><!-- col-sm-7 -->
            
            <div class="col-md-5">
                
                <form  class="form" id="login" >
                    <h4 class="nomargin">登 录</h4>
                    <p class="mt5 mb20">登录访问您的帐户.</p>
                    <div  id="loginNote" class="alert alert-info" ><strong>Well done!</strong></div>
                    <div class="form-group">
                    <input type="text" name="username" id="username" class="form-control uname" placeholder="用户名"  />
                    </div>
                    <div class="form-group">
                    <input type="password" name="password" id="password" class="form-control pword" placeholder="密码"  />
                    </div>
                    <button id="loginBtn"  type="submit" class="btn btn-success btn-block">登 录</button>
                    
                </form>
            </div><!-- col-sm-5 -->
            
        </div><!-- row -->
        
        <div class="signup-footer">
            <div class="pull-left">
                &copy; 2018 ~ 2020 镇江小众网路科技 技术支持
            </div>

        </div>
        
    </div><!-- signin -->

</section>

<script src="/res/common/jquery-1.11.1.min.js"></script>
<script src="/res/common/jquery-migrate-1.2.1.min.js"></script>
<script src="/res/common/jquery-ui-1.10.3.min.js"></script>
<script src="/res/lib/bost/bootstrap.js"></script>
<script src="/res/common/util.js"></script>
<script src="/res/common/modernizr.min.js"></script>
<script src="/res/common/jquery.cookies.js"></script>
<script src="/res/lib/director.js"></script>
<!--<script src="/res/script/share/validateRegExp.js"></script>-->
<script src="/res/lib/layer/layer.js"></script>
<link href="/res/lib/validator/css/bootstrapValidator.css" rel="stylesheet">
<script src="/res/lib/validator/js/bootstrapValidator.js"></script>


<script>
    $(function(){

        $('#login').bootstrapValidator({
            fields:{
                username: {
                    validators: {
                        notEmpty: {
                            message: '必须填写用户名'
                        }
                    }
                },
                password: {
                    validators: {
                        notEmpty: {
                            message: '必须填写密码'
                        }
                    }
                },
            }
        })
            .on('success.form.bv', function(e) {
                // Prevent form submission
                e.preventDefault();
                var $username=$("#username"),
                    $password=$("#password");
                var index = layer.load(0);
                // Get the form instance
                $.restPost("/user/doLogin",{
                    userName:$username.val(),
                    passWord:$password.val()
                }).done(function (msg,data) {
                    layer.close(index)
                    window.localStorage.setItem('token', data.token)
                    window.location.href="/admin/#/member/manage"

                }).fail(function (mess) {
                    layer.close(index)
                    $.rootErrorDialog(mess,3000)
                });

            });

    });
</script>

</body>
</html>
